/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.rec.be;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Diego
 */
@Entity
@Table(name = "REC_RESOLUCION_JUDICIAL")
@NamedQueries({@NamedQuery(name = "ResolucionJudicial.findAll", query = "SELECT r FROM ResolucionJudicial r"), @NamedQuery(name = "ResolucionJudicial.findByIdResolucionJudicial", query = "SELECT r FROM ResolucionJudicial r WHERE r.idResolucionJudicial = :idResolucionJudicial"), @NamedQuery(name = "ResolucionJudicial.findByArchivo", query = "SELECT r FROM ResolucionJudicial r WHERE r.archivo = :archivo"), @NamedQuery(name = "ResolucionJudicial.findByResumen", query = "SELECT r FROM ResolucionJudicial r WHERE r.resumen = :resumen"), @NamedQuery(name = "ResolucionJudicial.findByFechaRecepcion", query = "SELECT r FROM ResolucionJudicial r WHERE r.fechaRecepcion = :fechaRecepcion")})
public class ResolucionJudicial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_RESOLUCION_JUDICIAL", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idResolucionJudicial;
    @Column(name = "ARCHIVO", length = 500)
    private String archivo;
    @Column(name = "RESUMEN", length = 150)
    private String resumen;
    @Column(name = "FECHA_RECEPCION")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaRecepcion;
    @JoinColumn(name = "FID_REC_ACCION_JUDICIAL", referencedColumnName = "ID_ACCION_JUDICIAL")
    @ManyToOne(fetch = FetchType.LAZY)
    private AccionJudicial fidRecAccionJudicial;

    public ResolucionJudicial() {
    }

    public ResolucionJudicial(Long idResolucionJudicial) {
        this.idResolucionJudicial = idResolucionJudicial;
    }

    public Long getIdResolucionJudicial() {
        return idResolucionJudicial;
    }

    public void setIdResolucionJudicial(Long idResolucionJudicial) {
        this.idResolucionJudicial = idResolucionJudicial;
    }

    public String getArchivo() {
        return archivo;
    }

    public void setArchivo(String archivo) {
        this.archivo = archivo;
    }

    public String getResumen() {
        return resumen;
    }

    public void setResumen(String resumen) {
        this.resumen = resumen;
    }

    public Date getFechaRecepcion() {
        return fechaRecepcion;
    }

    public void setFechaRecepcion(Date fechaRecepcion) {
        this.fechaRecepcion = fechaRecepcion;
    }

    public AccionJudicial getFidRecAccionJudicial() {
        return fidRecAccionJudicial;
    }

    public void setFidRecAccionJudicial(AccionJudicial fidRecAccionJudicial) {
        this.fidRecAccionJudicial = fidRecAccionJudicial;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idResolucionJudicial != null ? idResolucionJudicial.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ResolucionJudicial)) {
            return false;
        }
        ResolucionJudicial other = (ResolucionJudicial) object;
        if ((this.idResolucionJudicial == null && other.idResolucionJudicial != null) || (this.idResolucionJudicial != null && !this.idResolucionJudicial.equals(other.idResolucionJudicial))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.rec.be.ResolucionJudicial[idResolucionJudicial=" + idResolucionJudicial + "]";
    }

}
